package com.bite.demo.service;

import com.bite.demo.dao.BookDao;
import com.bite.demo.model.BookInfo;
import org.springframework.stereotype.Component;

import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
import java.util.Random;

@Component
public class BookService {
    BookDao bookDao = new BookDao();
    public List<BookInfo> getList() {
        List<BookInfo> bookInfos = bookDao.mockDta();
        for (BookInfo bookInfo : bookInfos) {
            if (bookInfo.getState() == 1) {
                bookInfo.setStateCN("可借阅");
            } else {
                bookInfo.setStateCN("不可借阅");
            }
        }
        return bookInfos;
    }
}
